﻿<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>用户新增</title>
    <jsp:include page="/resources/inc/head.jsp" flush="true"/>
</head>
<body>
<div class="gray-bg">
    <div id="modal-form">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-body">
                    <div class="row">
                        <div class="col-sm-12 ">
                            <form class="form-horizontal m-t" id="createForm" novalidate="novalidate">
                                <input type="hidden" id="CSRFToken" name="CSRFToken" value="${CSRFToken}" />
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">账号：</label>
                                    <div class="col-sm-8">
                                        <input id="username" type="text" class="form-control" name="username" required="true" aria-required="true" maxlength="20">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">密码：</label>
                                    <div class="col-sm-8">
                                        <input id="password" type="password" class="form-control" name="password" required="true" maxlength="20">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">姓名：</label>
                                    <div class="col-sm-8">
                                        <input id="realname" type="text" class="form-control" name="realname" required="true"  maxlength="10">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">手机号：</label>
                                    <div class="col-sm-8">
                                        <input id="phone" type="text" digits="true" class="form-control" name="phone" maxlength="20">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">邮箱：</label>
                                    <div class="col-sm-8">
                                        <input id="email" type="email" email="true" class="form-control" name="email" maxlength="30">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">性别：</label>
                                    <div class="col-sm-8 m-t-xs">
                                        <label>
                                         <input type="radio" id="sex_1" name="sex" value="1" checked>男
                                         <input type="radio" id="sex_2" name="sex" value="2">女
                                        </label>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">状态：</label>
                                    <div class="col-sm-8 m-t-xs">
                                        <label>
                                             <input id="locked_0" type="radio" name="locked" value="0" checked>正常
                                             <input id="locked_0" type="radio" name="locked" value="1">锁定
                                        </label>
                                    </div>
                                </div>
                            </form>
                            <div class="col-sm-12 ">
                                <div class="pull-right">
                                    <button class="btn btn-sm btn-primary  " type="submit" onclick="createSubmit();">保存</button>
                                    <button class="btn btn-sm btn-white  " type="submit" onclick="cancel()">取消</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<jsp:include page="/resources/inc/footer.jsp" flush="true"/>
<script>
    $(function () {
    });

    function cancel(){
        aeye_close();
    }

    function createSubmit() {
        if($('#createForm').valid()){
                aeye_ajaxSubmit( '${basePath}/manage/user/create',$('#createForm').serialize());
        }
    }
</script>
</body>
</html>